<!--
* description: 反结算原因
* author: shensai
* createdDate:2021-1-18
-->
<template>
  <section class="editAreaAudit">
    <el-dialog
      v-dialogDrag
      :visible="popupsVisible"
      width="50%"
      height="80"
      :append-to-body="true"
      :close-on-click-modal="false"
      @close="closeEdit"
    >
      <dialogHeader
        slot="title"
        :title="titleName"
        :style-type="$store.state.app.dialogType"
      />

     
      <div class="filter-container filter-params">
        <el-row ref="vailComponentList" :gutter="26">
          <component
            :is="comp.component"
            v-for="comp in tableComponents1.filter(o => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds || ''"
            :code="formField[comp.codeField]"
            :disabled="comp.disabled"
            :is-require="comp.isRequire"
            :span="comp.span || 24"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :options="comp.options"
            :o-fields="comp.oFields"
            @changeCode="getComponentCode"
          />
        </el-row>
      </div>
            <div slot="footer" class="dialog-footer">
        <el-button
          v-for="comp in tableButtons"
          :key="comp.compKey"
          :type="comp.type"
          :icon="comp.icon"
          @click="comp.clickEvent"
        >{{ comp.text }}</el-button>
      </div>
    </el-dialog>
 
    
  </section>
</template>

<script>
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import { formMixins } from "@/components/mixins/formMixins";
import OneTableTemplate from "@/components/templates/oneTable";
import api from "@/api/subsidyManage";


export default {
  components: {
    OneTableTemplate,

    // inEdit,
    dialogHeader: () => import("@/components/dialogHeader")
  },

  // 组件混入对象
  mixins: [oneTableWithViewTemplateMixins, formMixins],
  props: {
    dataForForm: {
      type: Object,
      default: () => {}
    },
    isDialogVisible: {
      type: Boolean,
      default: false
    }
  },

  data() {
    const viewPageCode = "areaAudit-edit";

    return {
      
      editRowData: {},
      editPopupsState: '',
      editPopupsVisible: false,
      dynamicTags: [],
      inputValue: "",
      inputVisible: false,
      titleName: "反结算原因",
      inEditPopupsState: "",
      inEditRowData: {},
      inEditPopupsVisible: false,
      apiConfig: api.queryLog,
      // 动态组件-按钮
       tableButtons: [
        {
          compKey: 'btnKey1',
          type: 'primary',
          size: 'small',
          icon: 'iconfont  icon-preservation',
          clickEvent: () => this.save(),
          text: this.$t('sys.button.save') /* 保存*/,
          position: 'right'
        },
        {
          compKey: 'btnKey2',
          type: '',
          size: 'small',
          icon: 'iconfont  icon-cancel',
          clickEvent: () => this.close(),
          text: this.$t('sys.button.cancel') // 取消
        }
      ],
      // 动态组件-查询条件
      tableComponents1:
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path] &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
          .tableComponents &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
          .tableComponents.length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
              .tableComponents
          : [
              {
                compKey: "compKey1",
                labelName: "反结算原因：",
                codeField: "qualifiedCertNo",
                component: () => import("@/components/org/commonInput/textareaInput"),
                type: "inputText",
                isMust: true
              },
              {
                compKey: "compKey2",
                labelName: "反结算责任人：",
                codeField: "produceDate",
                component: () => import("@/components/org/commonInput"),
                type: "inputText",
                isMust: true,
                span:12,
                disabled:true
              },
         
            ],

      // 标题
      textMap: {
        edit: "区域审核"
      },

      // 表单数据（无需赋值，由混入对象赋值）
      formField: this.$utils.getFormField(
        this,
        {},
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode]
      )
    };
  },
  created() {
    this.formField = this.dataForForm;
  },
  methods: {
    // 关闭弹窗
    closeEdit() {
      this.$emit("close");
    },

  
  },
};
</script>

<style lang="scss" scoped>
.filter-title {
  font-size: 18px;
  font-weight: bolder;
}
.filter-container.filter-title::before {
  border-left: 4px solid #0075ff;
  padding-right: 10px;
  height: 20px;
  left: 0px;
  top: 4px;
}
.prompt {
  color: #e70020;
  font-size: 13px;
  height: 15px;
  line-height: 15px;
}
// /deep/.el-dialog__body {
//   height: 120px;
// }
/deep/.filter-params .el-col {
  margin-bottom: 15px;
}
.button-new-tag{
  width: 68px;
  height: 30px;
}
</style>
